﻿// Decompiled with JetBrains decompiler
// Type: Netick.Unity.NetickBehaviour
// Assembly: Netick.Unity, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: E128C7FD-39ED-4452-86AC-6EC748457030
// Assembly location: D:\WorkSpaceDemo\UPM\NetickForUnity\Netick\Runtime\Netick.Unity.dll
// XML documentation location: D:\WorkSpaceDemo\UPM\NetickForUnity\Netick\Runtime\Netick.Unity.xml

#nullable disable
namespace Netick.Unity;

public abstract class NetickBehaviour : NetickBaseBehaviour, INetickScript
{
  int INetickScript.Index { get; set; } = -1;

  /// <summary>
  /// The <see cref="T:Netick.Unity.NetworkSandbox" /> containing this <see cref="P:Netick.Unity.NetickBehaviour.Object" />.
  /// </summary>
  public NetworkSandbox Sandbox { get; internal set; }

  /// <summary>
  /// The <see cref="T:Netick.Unity.NetworkObject" /> this behaviour is attached to.
  /// </summary>
  public NetworkObject Object { get; internal set; }

  public Entity Entity { get; internal set; }

  public NetickEngine Engine { get; internal set; }

  void INetickScript.Initialize(NetickEngine engine)
  {
    this.Engine = engine;
    this.Sandbox = engine.UserObject as NetworkSandbox;
  }

  /// <summary>
  /// Called when this behaviour has been added to the simulation.
  /// </summary>
  public virtual void NetworkStart()
  {
  }

  /// <summary>
  /// Called when this behaviour has been removed from the simulation.
  /// </summary>
  public virtual void NetworkDestroy()
  {
  }

  /// <summary>Called every frame. Executed before NetworkFixedUpdate.</summary>
  public virtual void NetworkUpdate()
  {
  }

  /// <summary>
  /// Called every fixed-time network step. Any changes to the networked state should happen here.
  /// <para>On the client, if you are the Input Source or if this Object.PredictionMode is set to Everyone, it will be called several times in one update/tick during resimulations. To check for resimulations, use [<see cref="!:IsResimulating" />].</para>
  /// </summary>
  public virtual void NetworkFixedUpdate()
  {
  }

  /// <summary>
  /// Called every frame. Executed after NetworkUpdate and NetworkFixedUpdate.
  /// </summary>
  /// <para>IMPORTANT NOTE: properties (which can be interpolated) marked with [<see cref="T:Netick.Smooth" />] attribute will return interpolated values when accessed in this method.</para>
  public virtual void NetworkRender()
  {
  }

  public virtual void GameEngineIntoNetcode()
  {
  }

  public virtual void NetcodeIntoGameEngine()
  {
  }
}
